package com.teemor.im.remoting.session;

import com.teemor.im.common.model.User;
import com.teemor.im.discovery.node.ServerNode;

/**
 * @ename zhoulk
 * @cname 周李科
 * @date 2020/6/15 10:48
 */
public class RemoteSession implements ServerSession {


    private static final long serialVersionUID = -400010884211394846L;

    private String userId;
    private String sessionId;
    private ServerNode imNode;
    private boolean valid= true;

    public RemoteSession() {
        userId = "";
        sessionId = "";
        imNode = new ServerNode("unKnown", 0);
    }

    public RemoteSession(
            String sessionId, String userId, ServerNode imNode) {
        this.sessionId = sessionId;
        this.userId = userId;
        this.imNode = imNode;
    }

    @Override
    public void writeAndFlush(Object pkg) {

//        long nodeId = imNode.getId();
//        PeerSender sender =
//                PeerManager.getInst().getPeerSender(nodeId);
//
//        sender.writeAndFlush(pkg);
    }

    @Override
    public String getId() {
        return null;
    }

    @Override
    public String getSessionId() {
        return null;
    }

    @Override
    public boolean isValid() {
        return valid;
    }

    @Override
    public User getUser() {
        return null;
    }

    @Override
    public String getUserId() {
        return null;
    }

    @Override
    public ServerNode getServerNode() {
        return null;
    }



    public void setValid(boolean valid) {
        this.valid = valid;
    }
}
